package com.renwei.yunlong.utils;

import android.content.Context;
import android.text.TextUtils;

import com.renwei.yunlong.YunLongApplication;
import com.renwei.yunlong.http.Api;
import com.renwei.yunlong.http.HttpPresenter;
import com.renwei.yunlong.http.HttpTaskListener;

import java.util.HashMap;

/**
 * Project :  yunaandroid.
 * Package name: com.renwei.yunlong.utils
 * Created by :  Benjamin.
 * Created time: 2017/10/18 13:10
 * Changed by :  Benjamin.
 * Changed time: 2017/10/18 13:10
 * Class description:
 */

public class ServiceRequestManager {
    private static final ServiceRequestManager manager = new ServiceRequestManager();

    private ServiceRequestManager() {

    }

    public static ServiceRequestManager getManager() {
        return manager;
    }


    // app更新
    public void appUpdata(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        hp.setUrl(Api.$().APP_UPDATA);
        hp.setShowDialog(false);
        hp.putParam("jsonBean", jsonBean);
        hp.setRequsetId(1);
        hp.setCallBack(listener);
        hp.post();
    }

    // 推送登录
    public void pushInit(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_PUSH_URL);
        } else {
            hp.setUrl(Api.$().SERVICE_PUSH_URL);
        }
        hp.setShowDialog(false);
        hp.putParam("jsonBean", jsonBean);
        hp.setRequsetId(1001);
        hp.setCallBack(listener);
        hp.post();
    }

    // 推送登出
    public void pushLogout(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_PUSH_LOGOUT_URL);
        } else {
            hp.setUrl(Api.$().SERVICE_PUSH_LOGOUT_URL);
        }
        hp.setShowDialog(false);
        hp.putParam("jsonBean", jsonBean);
        hp.setRequsetId(1001);
        hp.setCallBack(listener);
        hp.post();
    }


    // 工单投诉率
    public void getWorkSolution(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_RESOLUTION_RATE_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_RESOLUTION_RATE_URL);
        }
        hp.putParam("jsonBean", jsonBean);
        hp.setShowDialog(false);
        hp.setCallBack(listener);
        hp.setRequsetId(1);
        hp.post();
    }

    // 工单SLA
    public void getWorkSLA(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_SLA_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_SLA_URL);
        }
        hp.putParam("jsonBean", jsonBean);
        hp.setShowDialog(false);
        hp.setCallBack(listener);
        hp.setRequsetId(1);
        hp.post();
    }

    // 工单满意率
    public void getWorkSatisfied(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_SATISFACTION_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_SATISFACTION_URL);
        }
        hp.putParam("jsonBean", jsonBean);
        hp.setShowDialog(false);
        hp.setCallBack(listener);
        hp.setRequsetId(1);
        hp.post();
    }

    // 工单投诉率
    public void getWorkComplain(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_COMPLAINT_RATE_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_COMPLAINT_RATE_URL);
        }
        hp.putParam("jsonBean", jsonBean);
        hp.setShowDialog(false);
        hp.setCallBack(listener);
        hp.setRequsetId(1);
        hp.post();
    }

    // 工单投诉率
    public void getChartService(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_QUERYDETAIL_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_CHART_SERVICE_URL);
        }
        hp.putParam("jsonBean", jsonBean);
        hp.setShowDialog(false);
        hp.setCallBack(listener);
        hp.setRequsetId(1);
        hp.post();
    }

    //登陆获取并获取公司和相关用户信息
    public void LoginAndQueryInfo(Context context, String loginType, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(loginType)) {
            hp.setUrl(Api.$().OWNER_LOGIN_URL);
        } else {
            hp.setUrl(Api.$().SERVICE_LOGIN_URL);
        }
        hp.setshowDialogcontent("正在登录");
        if ("1".equals(loginType)) {
            hp.setRequsetId(2);
        } else {
            hp.setRequsetId(1);
        }
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }


    //查询个人信息
    public void QueryInfomationByEmployeeId(Context context, String loginType, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(loginType)) {
            hp.setUrl(Api.$().OWNER_EMPLOYEE_URL);
        } else {
            hp.setUrl(Api.$().SERVICE_EMPLOYEE_URL);
        }
        hp.setShowDialog(false);
        if ("1".equals(loginType)) {
            hp.setRequsetId(3);
        } else {
            hp.setRequsetId(4);
        }
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }

    //修改服务商/业主密码信息
    public void changPassword(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_UPDATEPWD_URL);
            hp.setRequsetId(5);
        } else {
            hp.setUrl(Api.$().SERVICE_UPDATEPWD_URL);
            hp.setRequsetId(6);
        }
        hp.setshowDialogcontent("正在提交");
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }


    //忘记密码
    public void forgetPassword(Context context, String companyType, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(companyType)) {
            hp.setUrl(Api.$().OWNER_FORGETPWD_URL);
            hp.setRequsetId(7);
            LogUtil.e("forgetPassword  \r\n 修改服务商/业主密码 ---  url:" + Api.$().OWNER_FORGETPWD_URL);
            LogUtil.e("forgetPassword  \r\n 修改服务商/业主密码 ---params: " + jsonBean);
        } else {
            hp.setUrl(Api.$().SERVICE_FORGETPWD_URL);
            hp.setRequsetId(8);
            LogUtil.e("forgetPassword  \r\n 修改服务商/业主密码 ---  url:" + Api.$().SERVICE_FORGETPWD_URL);
            LogUtil.e("forgetPassword  \r\n 修改服务商/业主密码 ---params: " + jsonBean);
        }
        hp.setshowDialogcontent("正在提交");
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }

    //获取忘记密码验证码
    public void getForgetPwdCode(Context context, String companyType, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(companyType)) {
            hp.setUrl(Api.$().OWNER_URL + "sendVercode.htm");
            hp.setRequsetId(9);
        } else {
            hp.setUrl(Api.$().SERVICE_URL + "sendVercode.htm");
            hp.setRequsetId(10);
        }
        hp.setshowDialogcontent("正在获取");
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }

    //获取注册验证码
    public void getRegisterCode(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        hp.setUrl(Api.$().MiDDLE_URL + "sendVercode.htm");
        LogUtil.e("getRegisterCode  \r\n 获取注册验证码---  url:" + Api.$().MiDDLE_URL + "sendVercode.htm");
        LogUtil.e("getRegisterCode  \r\n 获取注册验证码---  params:" + jsonBean);
        hp.setRequsetId(11);
        hp.putParam("mobilePhone", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }

    //注册新用户
    public void register2Server(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        hp.setUrl(Api.$().MiDDLE_REGISTER_URL);
        hp.setRequsetId(12);
        LogUtil.e("register2Server  \r\n 注册新用户---  url:" + Api.$().MiDDLE_REGISTER_URL);
        LogUtil.e("register2Server  \r\n 注册新用户 ---params: \r\n 这里根据companyCode判断平台：" + jsonBean);
        hp.setshowDialogcontent("正在提交");
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }


    //查询其他人员个人信息
    public void QueryUserInfoDisplay(Context context, String jsonBean, HttpTaskListener listener) {
        LogUtil.e("QueryUserInfoDisplay:" + jsonBean);
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_EMPLOYEE_URL);
            LogUtil.e("方法:QueryUserInfoDisplay--: \r\n  owner  URL:" + Api.$().OWNER_EMPLOYEE_URL + " \r\n params" + jsonBean);
        } else {
            hp.setUrl(Api.$().SERVICE_EMPLOYEE_URL);
            LogUtil.e("方法:QueryUserInfoDisplay--: \r\n service  URL:" + Api.$().OWNER_EMPLOYEE_URL + " \r\n params" + jsonBean);
        }
        hp.setshowDialogcontent("正在提交信息...");
        hp.setRequsetId(16);
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }

    //添加企业好友
    public void AddEmployee(Context context, String jsonBean, HttpTaskListener listener) {
        LogUtil.e("jsonBean" + jsonBean);
        LogUtil.e("QueryUserInfoDisplay:" + jsonBean);
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_EMP_SAVE, 1000 * 60);
            LogUtil.e("方法:AddEmployee--: \r\n  owner  URL:" + Api.$().OWNER_EMP_SAVE + " \r\n params" + jsonBean);
        } else {
            hp.setUrl(Api.$().SERVICE_EMP_SAVE, 1000 * 60);
            LogUtil.e("方法:AddEmployee--: \r\n service  URL:" + Api.$().SERVICE_EMP_SAVE + " \r\n params" + jsonBean);
        }
        hp.setshowDialogcontent("正在提交信息...");
        hp.setRequsetId(17);
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }


    //提交到达时候的位置
    public void CommitArrivedPosition(Context context, String jsonBean, HttpTaskListener listener) {
        LogUtil.e("QueryUserInfoDisplay:" + jsonBean);
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_DAODA_URL);
            LogUtil.e("方法:CommitArrivedPosition--: \r\n  owner  URL:" + Api.$().OWNER_DAODA_URL + " \r\n params" + jsonBean);
        } else {
            hp.setUrl(Api.$().SERVICE_DAODA_URL);
            LogUtil.e("方法:CommitArrivedPosition--: \r\n service  URL:" + Api.$().SERVICE_DAODA_URL + " \r\n params" + jsonBean);
        }
        hp.setshowDialogcontent("正在提交信息...");
        hp.setRequsetId(1);
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }

    //获取轨迹
    public void getWorkLatLng(Context context, String outsourceFlag, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            if (TextUtils.isEmpty(outsourceFlag) || "0".equals(outsourceFlag)) {
                hp.setUrl(Api.$().OWNER_TRACK_URL);
            } else {
                hp.setUrl(Api.$().SERVICE_TRACK_URL);
            }
        } else {
            hp.setUrl(Api.$().SERVICE_TRACK_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(2);
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }

    //申领问题
    public void ApplyProblems(Context context, String jsonBean, HttpTaskListener listener) {
        LogUtil.e("QueryUserInfoDisplay:" + jsonBean);
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_SHENLING_URL);
            LogUtil.e("方法:ApplyProblems--: \r\n  owner  URL:" + Api.$().OWNER_SHENLING_URL + " \r\n params" + jsonBean);
        } else {
            hp.setUrl(Api.$().SERVICE_SHENLING_URL);
            LogUtil.e("方法:ApplyProblems--: \r\n service  URL:" + Api.$().SERVICE_SHENLING_URL + " \r\n params" + jsonBean);
        }
        hp.setshowDialogcontent("正在提交");
        hp.setRequsetId(18);
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }


    /***
     * 更新用户信息--- 双平台
     * @param context
     * @param jsonBean
     * @param listener
     */
    public void updateUserInfo(Context context, String jsonBean, HttpTaskListener listener) {
        LogUtil.e("updateUserInfo:" + jsonBean);
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_UPDATE_USER_INFO);
            LogUtil.e("updateUserInfo   :" + Api.$().OWNER_UPDATE_USER_INFO + "\r\n"
                    + jsonBean);
        } else {
            hp.setUrl(Api.$().SERVICE_UPDATE_USER_INFO);
            LogUtil.e("updateUserInfo   :" + Api.$().SERVICE_UPDATE_USER_INFO + "\r\n"
                    + jsonBean);
        }
        hp.setshowDialogcontent("正在提交信息...");
        hp.setRequsetId(888);
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }


    //意见反馈--中间平台
    public void middleFeedBack(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        hp.setUrl(Api.$().MIDDLE_TICKLING_URL);
        hp.setshowDialogcontent("正在提交");
        hp.setRequsetId(887);
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }

    //更新企业信息--- 中间平台
    public void UpdateCompanyInfo(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        hp.setUrl(Api.$().UPDATE_COMPANY_INFO);
        LogUtil.e(Api.$().UPDATE_COMPANY_INFO);
        hp.setshowDialogcontent("正在提交");
        hp.setRequsetId(886);
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }

    //查询技术专长接口 -- 双平台
    public void QuerySpecialty(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_QUERY_SPECIALTY);
            LogUtil.e(Api.$().OWNER_QUERY_SPECIALTY);
        } else {
            hp.setUrl(Api.$().SERVICE_QUERY_SPECIALTY);
            LogUtil.e(Api.$().SERVICE_QUERY_SPECIALTY);
        }
        hp.setshowDialogcontent("正在加载数据");
        hp.setRequsetId(885);
        //hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }


    //更新技术专长接口 -- 双平台
    public void UpdateSpecialty(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_UPDATE_SPECIALTY);
            LogUtil.e(Api.$().OWNER_UPDATE_SPECIALTY);
        } else {
            hp.setUrl(Api.$().SERVICE_UPDATE_SPECIALTY);
            LogUtil.e(Api.$().SERVICE_UPDATE_SPECIALTY);
        }
        hp.setshowDialogcontent("正在提交");
        hp.setRequsetId(884);
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }


    //个人资质证书查询
    public void QueryUserCertificate(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_SELF_QUERY_CERTIFICATE);
            LogUtil.e("QueryUserCertificate-----个人资质证书查询接口URL:" + Api.$().OWNER_SELF_QUERY_CERTIFICATE + "接口param ---：" + jsonBean);
        } else {
            hp.setUrl(Api.$().SERVICE_SELF_QUERY_CERTIFICATE);
            LogUtil.e("QueryUserCertificate-----个人资质证书查询接口URL:" + Api.$().SERVICE_SELF_QUERY_CERTIFICATE + "接口param ---：" + jsonBean);
        }
        hp.setshowDialogcontent("正在加载数据");
        hp.setRequsetId(883);
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }

    //查询其他人个人证书列表
    public void QueryOtherCertificate(Context context, String companyType, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(companyType)) {
            hp.setUrl(Api.$().OWNER_SELF_QUERY_CERTIFICATE);
            LogUtil.e("QueryOtherCertificate-----查询其他人个人证书列表接口URL:" + Api.$().OWNER_SELF_QUERY_CERTIFICATE + "接口param ---：" + jsonBean);
        } else {
            hp.setUrl(Api.$().SERVICE_SELF_QUERY_CERTIFICATE);
            LogUtil.e("QueryOtherCertificate-----查询其他人个人证书列表接口URL:" + Api.$().SERVICE_SELF_QUERY_CERTIFICATE + "接口param ---：" + jsonBean);
        }
        hp.setshowDialogcontent("正在加载数据");
        hp.setRequsetId(8830);
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }

    //个人资质证书提交
    public void UserCommitCertificate(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_SELF_COMMIT_CERTIFICATE);
            LogUtil.e("方法:UserCommitCertificate--: \r\n  owner  URL:" + Api.$().OWNER_SELF_COMMIT_CERTIFICATE + " \r\n params" + jsonBean);
        } else {
            hp.setUrl(Api.$().SERVICE_SELF_COMMIT_CERTIFICATE);
            LogUtil.e("方法:UserCommitCertificate--: \r\n service  URL:" + Api.$().SERVICE_SELF_COMMIT_CERTIFICATE + " \r\n params" + jsonBean);
        }
        hp.setshowDialogcontent("正在提交");
        hp.setRequsetId(882);
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }

    //企业资质证书提交
    public void CompanyCommitCertificate(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        hp.setUrl(Api.$().COMPANY_MIDDLE_COMMIT_CERTIFICATE);
        LogUtil.e("提交企业资质或者证书 :CompanyCommitCertificate--: \r\n  owner  URL:" + Api.$().COMPANY_MIDDLE_COMMIT_CERTIFICATE + " \r\n params" + jsonBean);
        hp.setshowDialogcontent("正在提交");
        hp.setRequsetId(881);
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }

    //个人资质证书查询
    public void QueryCompanyCertificate(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        hp.setUrl(Api.$().COMPANY_MIDDLE_QUERY_CERTIFICATE);
        LogUtil.e("QueryCompanyCertificate-----接口URL:" + Api.$().COMPANY_MIDDLE_QUERY_CERTIFICATE + "接口param ---：" + jsonBean);
        hp.setshowDialogcontent("正在提交");
        hp.setRequsetId(880);
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }

    //查看好友企业信息
    public void QueryFirendCompany(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        hp.setUrl(Api.$().MIDDLE_QUERY_FIREND_COMPANY);
        LogUtil.e("QueryFirendCompany-----接口URL:" + Api.$().MIDDLE_QUERY_FIREND_COMPANY + "接口param ---：" + jsonBean);
        hp.setShowDialog(false);
        hp.setRequsetId(879);
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }

    //查看自建企业信息
    public void QueryUserCompany(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_COMPANY_URL);
        } else {
            hp.setUrl(Api.$().SERVICE_COMPANY_URL);
        }
        hp.setshowDialogcontent("正在查询");
        hp.setRequsetId(880);
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }

    //扫描企业二维码
    public void ScanCompanyQRcode(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        hp.setUrl(Api.$().OWNER_SCANNER_COMPANY_URL);
        hp.setshowDialogcontent("正在查询");
        hp.setRequsetId(880);
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }


    //删除资质证书
    public void DeleteCompanyCertificate(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        hp.setUrl(Api.$().MIDDLE_DELETE_COMPANY_CERTIFICATE);
        LogUtil.e("DeleteCompanyCertificate-----接口URL:" + Api.$().MIDDLE_DELETE_COMPANY_CERTIFICATE + "接口param ---：" + jsonBean);
        hp.setshowDialogcontent("正在删除");
        hp.setRequsetId(878);
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }

    //删除个人证书
    public void DeleteUserCertificate(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_DELETE_USER_CERTIFICATE);
            LogUtil.e("方法:DeleteUserCertificate--: \r\n  owner  URL:" + Api.$().OWNER_DELETE_USER_CERTIFICATE + " \r\n params" + jsonBean);
        } else {
            hp.setUrl(Api.$().SERVICE_DELETE_USER_CERTIFICATE);
            LogUtil.e("方法:DeleteUserCertificate--: \r\n service  URL:" + Api.$().SERVICE_DELETE_USER_CERTIFICATE + " \r\n params" + jsonBean);
        }
        hp.setshowDialogcontent("正在删除");
        hp.setRequsetId(877);
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }

    //获取问题 投诉的权限 nowState
    public void getProbCompState(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_POBLCOMP_STATE_URL);
        } else {
            hp.setUrl(Api.$().SERVICE_POBLCOMP_STATE_URL);
        }
        hp.putParam("jsonBean", jsonBean);
        hp.setShowDialog(false);
        hp.setCallBack(listener);
        hp.post();
    }

    //获取站内消息列表
    public void getMsgList(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_MESSAGE_NOTICE_LIST);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_MESSAGE_NOTICE_LIST);
        }
        hp.putParam("jsonBean", jsonBean);
        hp.setRequsetId(1);
        hp.setshowDialogcontent("正在加载");
        hp.setCallBack(listener);
        hp.post();
    }

    //处理工单处理
    public void dealWorkProblem(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_WENTIQUE_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_WENTIQUE_URL);
        }
        hp.putParam("jsonBean", jsonBean);
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1);
        hp.setCallBack(listener);
        hp.post();
    }

    //待办 经办 列表
    public void getWorkList(Context context, String upcoming, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(upcoming)) {//待办
            if ("2".equals(YunLongApplication.getCompanyType())) {
                hp.setUrl(Api.$().SERVICE_UPCOMING_URL);
            } else if ("1".equals(YunLongApplication.getCompanyType())) {
                hp.setUrl(Api.$().OWNER_UPCOMING_URL);
            }
        } else if ("2".equals(upcoming)) {
            if ("2".equals(YunLongApplication.getCompanyType())) {
                hp.setUrl(Api.$().SERVICE_JINBAN_URL);
            } else if ("1".equals(YunLongApplication.getCompanyType())) {
                hp.setUrl(Api.$().OWNER_JINBAN_URL);
            }
        } else if ("0".equals(upcoming)) {
            if ("2".equals(YunLongApplication.getCompanyType())) {
                hp.setUrl(Api.$().SERVICE_WORK_ALL_URL);
            } else if ("1".equals(YunLongApplication.getCompanyType())) {
                hp.setUrl(Api.$().OWNER_WORK_ALL_URL);
            }
        }
        hp.setShowDialog(false);
        hp.putParam("jsonBean", jsonBean).setCallBack(listener).setRequsetId(3).post();
    }

    //工单指派  企业
    public void workOrderAssign(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        hp.setUrl(Api.$().OWNER_QUERYSERVERINFO_URL);
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1);
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }

    // 对象 备件 详情
    public void getObjectDetail(Context context, String outSourceFlag, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            if (TextUtils.isEmpty(outSourceFlag) || "0".equals(outSourceFlag)) {
                hp.setUrl(Api.$().OWNER_NEWDETAILS_URL);
            } else {
                hp.setUrl(Api.$().SERVICE_NEWDETAILS_URL);
            }
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_NEWDETAILS_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }

    // 对象 备件 类型
    public void getObjectType(Context context, String outSourceFlag, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            if (TextUtils.isEmpty(outSourceFlag) || "0".equals(outSourceFlag)) {
                hp.setUrl(Api.$().OWNER_WARETYPE_URL);
            } else {
                hp.setUrl(Api.$().SERVICE_WARETYPE_URL);
            }
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_WARETYPE_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }

    // 对象 备件 相关
    public void getObjectRelated(Context context, String outSourceFlag, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            if ("0".equals(outSourceFlag) || TextUtils.isEmpty(outSourceFlag)) {
                hp.setUrl(Api.$().OWNER_WARECORR_URL);
            } else {
                hp.setUrl(Api.$().SERVICE_WARECORR_URL);
            }
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_WARECORR_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }

    // 对象 备件 附件
    public void getObjectAnnex(Context context, String outSourceFlag, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            if ("0".equals(outSourceFlag) || TextUtils.isEmpty(outSourceFlag)) {
                hp.setUrl(Api.$().OWNER_APPLIST_URL);
            } else {
                hp.setUrl(Api.$().SERVICE_APPLIST_URL);
            }
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_APPLIST_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }


    // 对象 备件 服务
    public void getObjectService(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_WARESERVER_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_WARESERVER_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }

    // 获取切换公司数据
    public void getOtherCompany(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_SWITCH_COMPANY);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_SWITCH_COMPANY);
        }
        hp.putParam("jsonBean", jsonBean);
        hp.setRequsetId(1);
        hp.setshowDialogcontent("正在加载");
        hp.setCallBack(listener);
        hp.post();
    }

    // 切换公司
    public void updateCompany(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_CHECK_COMPANY);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_CHECK_COMPANY);
        }
        hp.putParam("jsonBean", jsonBean);
        hp.setRequsetId(2);
        hp.setshowDialogcontent("正在加载");
        hp.setCallBack(listener);
        hp.post();
    }

    // 我的待办数量统计
    public void getWorkNumber(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_WORK_NUMBER_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_WORK_NUMBER_URL);
        }
        hp.putParam("jsonBean", jsonBean);
        hp.setRequsetId(6);
        hp.setShowDialog(false);
        hp.setCallBack(listener);
        hp.post();
    }

    // 待办经办 企业筛选
    public void getCompanyChoose(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_QUERYSERVERINFO_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_QUERYSERVERINFO_URL);
        }
        hp.putParam("jsonBean", jsonBean);
        hp.setRequsetId(4);
        hp.setShowDialog(false);
        hp.setCallBack(listener);
        hp.post();
    }

    // 待办经办 项目筛选
    public void getProjectChoose(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_WORK_SCREEN_PROJECT);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_WORK_SCREEN_PROJECT);
        }
        hp.putParam("jsonBean", jsonBean);
        hp.setRequsetId(5);
        hp.setShowDialog(false);
        hp.setCallBack(listener);
        hp.post();
    }

    // 待办经办 项目筛选  服务
    public void getServiceFloder(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_QUERYDETAIL_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_QUERYDETAIL_URL);
        }
        hp.putParam("jsonBean", jsonBean);
        hp.setRequsetId(5);
        hp.setShowDialog(false);
        hp.setCallBack(listener);
        hp.post();
    }

    //6.5消息列表未读数量统计
    public void getUnreadMsg(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_MESSAGE_LIST);
        } else {
            hp.setUrl(Api.$().SERVICE_MESSAGE_LIST);
        }
        hp.setRequsetId(1);
        hp.putParam("jsonBean", jsonBean);
        hp.setShowDialog(false);
        hp.setCallBack(listener);
        hp.post();
    }

    // 投诉处理 选择服务台
    public void getComplainPerson(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_COMPLAIN_PERSON_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_COMPLAIN_PERSON_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.putParam("currentUserId", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }

    // 发起工单  选择发起人
    public void getWorkSendPerson(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        hp.setUrl(Api.$().SERVICE_QUERYEMPLOYEE_URL);
        hp.setshowDialogcontent("正在加载");
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }


    // 发起工单  选择发起企业
    public void getWorkSendCompany(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        hp.setUrl(Api.$().SERVICE_QUERYSERVERINFO_URL);
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1);
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }

    // 发起工单  选择处理人
    public void getWorkDealPerson(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_QUERYASSIGN_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_QUERYSYNEMPLOyYEE_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }

    // 发起工单  选择项目
    public void getWorkProject(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        hp.setUrl(Api.$().SERVICE_QUERYCONTRACT_URL);
        hp.setshowDialogcontent("正在加载");
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }

    // 发起工单  选择对象
    public void getWorkAsset(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_QUERYSEARCH_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_QUERYHARD_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.setRequsetId(1);
        hp.post();
    }


    // 发起工单  选择服务
    public void getWorkService(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_QUERYDETAIL_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_QUERYDETAIL_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1);
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }

    // 发起工单  sla
    public void getSendWorkSLA(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_MINUTE_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_MINUTE_URL);
        }
        hp.setShowDialog(false);
        hp.setRequsetId(1).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 发起工单  对象联动
    public void getSendWorkHandware(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_HANDWARE_LIST_URL);
        }
        hp.setShowDialog(false);
        hp.setRequsetId(2).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 发起工单
    public void sendWorkOrder(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_SAVE_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_SAVE_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 工单详情
    public void getWorkDetail(Context context, String outsourceFlag, boolean isShow, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType()) &&
                ("0".equals(outsourceFlag) || TextUtils.isEmpty(outsourceFlag))) {
            hp.setUrl(Api.$().OWNER_DETAIL_URL);
        } else {//服务商
            hp.setUrl(Api.$().SERVICE_DETAIL_URL);
        }
        hp.setShowDialog(isShow);
        hp.setRequsetId(1).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 工单记录
    public void getWorkRecording(Context context, String outsourceFlag, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType()) &&
                ("0".equals(outsourceFlag) || TextUtils.isEmpty(outsourceFlag))) {
            hp.setUrl(Api.$().OWNER_PROCESS_URL);
        } else {//服务商
            hp.setUrl(Api.$().SERVICE_PROCESS_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 工单附件
    public void getWorkAnnex(Context context, String outsourceFlag, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType()) &&
                ("0".equals(outsourceFlag) || TextUtils.isEmpty(outsourceFlag))) {
            hp.setUrl(Api.$().OWNER_ANNEX_URL);
        } else {//服务商
            hp.setUrl(Api.$().SERVICE_ANNEX_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 工单历史
    public void getWorkHistory(Context context, String outsourceFlag, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType()) &&
                ("0".equals(outsourceFlag) || TextUtils.isEmpty(outsourceFlag))) {
            hp.setUrl(Api.$().OWNER_HISTORY_URL);
        } else {//服务商
            hp.setUrl(Api.$().SERVICE_HISTORY_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 工单历史
    public void getWorkRelate(Context context, String outsourceFlag, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType()) &&
                ("0".equals(outsourceFlag) || TextUtils.isEmpty(outsourceFlag))) {
            hp.setUrl(Api.$().OWNER_RELATION_URL);
        } else {//服务商
            hp.setUrl(Api.$().SERVICE_RELATION_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 工单 下一步 出发
    public void setWorkChufa(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_CHUFA_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_CHUFA_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 工单 下一步 备件申请
    public void getSpareState(Context context, String requestId, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_BEISHEN_URL);
            hp.putParam("requestId", requestId);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_BEISHEN_URL);
            HashMap<String, String> map = new HashMap<>();
            map.put("requestId", requestId);
            hp.putParam("jsonBean", JsonMapUtil.mapToJson(map));
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(3).setCallBack(listener).post();
    }

    // 获取工单指派信息
    public void getWorkAssigned(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_ZHIPAI_INFO_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_ZHIPAI_INFO_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 工单 下一步 备件申请
    public void setWorkAssigned(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_ZHIPAI_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_ZHIPAI_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(2).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 工单 下一步 关闭 取消
    public void setWorkClose(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_CLOSE_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_CLOSE_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 工单 下一步 转回
    public void setWorkReturn(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_ZHUAN_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_ZHUAN_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(2).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 工单 下一步 挂起 启动
    public void setWorkStart(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_GUAQI_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_GUAQI_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(2).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 工单 下一步 投诉
    public void setWorkComplain(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_WORKTOUSU_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_WORKTOUSU_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 工单 下一步 确认
    public void setWorkConfirm(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_WANCHENG_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_WANCHENG_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 工单 下一步 备件申请
    public void setWorkSpare(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_BEIJIAN_NEXT_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_BEIJIAN_NEXT_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    /**
     * 按部门查看部门查询接口（一级）
     *
     * @param context
     * @param jsonBean 当前用户的员工ID
     * @param listener 监听
     */
    public void queryContactByDepartmentOne(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_QUERY_CONTACT_DEPARTMENT_ONE);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_QUERY_CONTACT_DEPARTMENT_ONE);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1);
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }


    /**
     * 按部门查看部门查询接口（二级）
     *
     * @param context
     * @param jsonBean json
     * @param listener 监听
     */
    public void queryContactByDepartmentTwo(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_QUERY_CONTACT_DEPARTMENT_TWO);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_QUERY_CONTACT_DEPARTMENT_TWO);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1);
        hp.putParam("jsonBean", jsonBean);
        hp.setCallBack(listener);
        hp.post();
    }


    /**
     * 按职能查看联系人列表
     *
     * @param context       上下文
     * @param currentUserId 当前使用者的员工Id
     * @param listener      监听
     */
    public void queryContactByFunction(Context context, String currentUserId, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_GROUP_EMPINFO);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_GROUP_EMPINFO);
        }
        hp.putParam("currentUserId", currentUserId);
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1);
        hp.setCallBack(listener);
        hp.post();
    }

    // 工单 下一步 备件申请 选择服务目录
    public void getWorkSpareServer(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_WORK_SPARE_SERVER);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_WORK_SPARE_SERVER);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 工单 下一步 获取草稿
    public void getWorkHandler(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_HANDLE_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_HANDLE_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 工单 下一步 处理
    public void setWorkHandler(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_HANDLEWORK_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_HANDLEWORK_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(2).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 投诉 反馈结果
    public void getComplainResult(Context context, String outsourceFlag, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            if ("0".equals(outsourceFlag) || TextUtils.isEmpty(outsourceFlag)) {
                hp.setUrl(Api.$().OWNER_COMPLAIN_RESULT);
            } else {
                hp.setUrl(Api.$().SERVICE_COMPLAIN_RESULT);
            }
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_COMPLAIN_RESULT);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 问题  相关问题
    public void getProblemRelate(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_PROBLEM_RELATE);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_PROBLEM_RELATE);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 问题  指派
    public void setProblemAssign(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_ZHIPAIGEI_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_ZHIPAIGEI_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 投诉  指派
    public void setComplainAssign(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_COMP_ZHIPAIGEI_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_COMP_ZHIPAIGEI_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(2).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 问题  关闭
    public void setProblemClose(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_PROBLEM_GUANBI_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_PROBLEM_GUANBI_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 投诉  确认
    public void setProblemConfirm(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_WENTIQUE_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_WENTIQUE_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 备件 明细
    public void getSpareDetail(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_SPAREPAR_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_SPAREPAR_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1).putParam("id", jsonBean).setCallBack(listener).post();
    }

    // 备件 确认收货
    public void setSpareGoods(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_GOODS_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_GOODS_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(2).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 备件 审核
    public void setSpareAudit(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_AUDIT_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_AUDIT_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }


    // 根据关键字查询联系人信息
    public void queryContactByCharacter(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_ALL_EMPINFO);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_ALL_EMPINFO);
        }
        hp.setShowDialog(false);
        hp.setRequsetId(1).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 工单 上传 签名
    public void setWorkDesign(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_BIANGENG_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_BIANGENG_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }


    public void getCompanyMsgCount(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_MESSAGE_COMPANY_COUNT);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_MESSAGE_COMPANY_COUNT);
        }
        hp.setShowDialog(false);
        hp.setRequsetId(666).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 查询企业好友相关消息
    public void queryCompanyInviteMsg(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_MESSAGE_COMPANY_SEND);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_MESSAGE_COMPANY_RECEIVED);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(666).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 查询企业好友相关消息
    public void getcompanyMsgDetail(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_MESSAGE_COMPANY_DETAIL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_MESSAGE_COMPANY_DETAIL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(666).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    //5.3查询好友企业联系人
    public void queryFriendCompanyContact(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_FRIEND_COMPANY_CONTACT_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_FRIEND_COMPANY_CONTACT_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(666).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 备件申请 备件选择
    public void getSpareSelectList(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_BEIXUAN_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_BEIXUAN_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 我的 查询  对象查询
    public void getObjectList(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_QUERYWARE_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_QUERYWARE_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 我的 查询  备件查询
    public void getSpareList(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_QUERYHARDWARE_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_QUERYHARDWARE_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(2).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 我的 查询  问题查询
    public void getQuestionList(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_QUERYPROBLEM_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_QUERYPROBLEM_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(3).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 消息 详情
    public void getMessageDetail(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_MESSAGE_NOTICE_DETAIL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_MESSAGE_NOTICE_DETAIL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(2).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 消息 状态设置
    public void setMessageState(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_MESSAGE_STATE_SETTING);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_MESSAGE_STATE_SETTING);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(2).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 查询好友企业
    public void queryFriendCompany(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_COMPANY_EMPINFO);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_COMPANY_EMPINFO);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(2).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }


    // 添加员工到部门
    public void querDepartment(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_DEP_CHOOSE);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_DEP_CHOOSE);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    // 查看所有职能能信息
    public void searchFunctionGroup(Context context, String json, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_GROUP_CHOOSE);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_GROUP_CHOOSE);
        }
        hp.putParam("jsonBean", json);
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1);
        hp.setCallBack(listener);
        hp.post();
    }

    // 更新消息状态
    public void updateMessageFlag(Context context, String json, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_UPDATE_MSG);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_UPDATE_MSG);
        }
        hp.putParam("jsonBean", json);
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(2);
        hp.setCallBack(listener);
        hp.post();
    }

    // sla详情接口
    public void getSlaCompliacRate(Context context, String outSourceFlag, String json, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            if (TextUtils.isEmpty(outSourceFlag) || "0".equals(outSourceFlag)) {
                hp.setUrl(Api.$().OWNER_WORK_SLA);
            } else {
                hp.setUrl(Api.$().SERVICE_WORK_SLA);
            }
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_WORK_SLA);
        }
        hp.putParam("jsonBean", json);
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1);
        hp.setCallBack(listener);
        hp.post();
    }

    // 更新消息状态
    public void getGuideList(Context context, String json, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_GUIDE_LIST);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_GUIDE_LIST);
        }
        hp.putParam("jsonBean", json);
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(2);
        hp.setCallBack(listener);
        hp.post();
    }

    // 检查是否第一次登陆
    public void checkLoginGuide(Context context, String json, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_GUIDE_LOGIN);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_GUIDE_LOGIN);
        }
        hp.putParam("jsonBean", json);
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(888);
        hp.setCallBack(listener);
        hp.post();
    }

    // 更新模块选中
    public void uploadGuideCheck(Context context, String json, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_GUIDE_CHECK);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_GUIDE_CHECK);
        }
        hp.putParam("jsonBean", json);
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(889);
        hp.setCallBack(listener);
        hp.post();
    }

    // 扫码查询对象
    public void scannerObject(Context context, String json, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_SCANNER_OBJECT);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_SCANNER_OBJECT);
        }
        hp.putParam("jsonBean", json);
        hp.setshowDialogcontent("正在查询");
        hp.setRequsetId(889);
        hp.setCallBack(listener);
        hp.post();
    }

    // 查询投诉责任人
    public void getComplainDealPerson(Context context, String json, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_COMPLAIN_DEAL_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_COMPLAIN_DEAL_URL);
        }
        hp.putParam("jsonBean", json);
        hp.setshowDialogcontent("正在查询");
        hp.setRequsetId(1);
        hp.setCallBack(listener);
        hp.post();
    }

    // 确认投诉责任人
    public void setComplainDealPerson(Context context, String json, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_COMPLAIN_SAVE_DEAL_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_COMPLAIN_SAVE_DEAL_URL);
        }
        hp.putParam("jsonBean", json);
        hp.setshowDialogcontent("正在查询");
        hp.setRequsetId(2);
        hp.setCallBack(listener);
        hp.post();
    }

    // 融云 发起聊天
    public void creatChatGroup(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        hp.setUrl(Api.$().MESSAGE_CREAT_GROUP);
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    //融云 查看群成员
    public void getChatGroupMember(Context context, String groupId, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        hp.setUrl(Api.$().MESSAGE_GROUP_INFO);
        hp.putParam("groupId", groupId);
        hp.setshowDialogcontent("正在查询");
        hp.setRequsetId(1);
        hp.setCallBack(listener);
        hp.post();
    }

    //融云 退出群组 删除人员
    public void exitChatGroup(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        hp.setUrl(Api.$().MESSAGE_REMOVE_EMP);
        hp.putParam("jsonBean", jsonBean);
        hp.setshowDialogcontent("正在退出");
        hp.setRequsetId(2);
        hp.setCallBack(listener);
        hp.post();
    }

    //融云 解散群组
    public void deleteChatGroup(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        hp.setUrl(Api.$().MESSAGE_DELETE_GROUP);
        hp.putParam("jsonBean", jsonBean);
        hp.setshowDialogcontent("正在退出");
        hp.setRequsetId(2);
        hp.setCallBack(listener);
        hp.post();
    }

    //融云 修改群名称
    public void updateGroupName(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        hp.setUrl(Api.$().UPDATE_GROUP);
        hp.putParam("jsonBean", jsonBean);
        hp.setshowDialogcontent("正在修改");
        hp.setRequsetId(1);
        hp.setCallBack(listener);
        hp.post();
    }

    // 我的 查询  知识库库查询
    public void getKnowList(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {//业主
            hp.setUrl(Api.$().OWNER_QUERYKNOW_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {//服务商
            hp.setUrl(Api.$().SERVICE_QUERYKNOW_URL);
        }
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(4).putParam("jsonBean", jsonBean).setCallBack(listener).post();
    }

    //知识库详情
    public void getKnowDetails(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_KNOW_DETAILS_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_KNOW_DETAILS_URL);
        }
        hp.putParam("jsonBean", jsonBean);
        hp.setshowDialogcontent("正在查询");
        hp.setRequsetId(1);
        hp.setCallBack(listener);
        hp.post();
    }

    //知识库 收藏
    public void setKnowLike(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_KNOW_LIKE_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_KNOW_LIKE_URL);
        }
        hp.putParam("jsonBean", jsonBean);
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(2);
        hp.setCallBack(listener);
        hp.post();
    }

    //知识库 发送评论
    public void sendComment(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_KNOW_SEND_COMMENT_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_KNOW_SEND_COMMENT_URL);
        }
        hp.putParam("jsonBean", jsonBean);
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(3);
        hp.setCallBack(listener);
        hp.post();
    }

    // 知识库 评论列表
    public void getKnowCommentList(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_KNOW_COMMENT_LIST_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_KNOW_COMMENT_LIST_URL);
        }
        hp.putParam("jsonBean", jsonBean);
        hp.setShowDialog(false);
        hp.setRequsetId(1);
        hp.setCallBack(listener);
        hp.post();
    }

    // 知识库 增加访问量
    public void setKnowNumView(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_KNOW_NUM_VIEW_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_KNOW_NUM_VIEW_URL);
        }
        hp.putParam("jsonBean", jsonBean);
        hp.setShowDialog(false);
        hp.setRequsetId(10);
        hp.setCallBack(listener);
        hp.post();
    }

    // 知识库 点赞或取消点赞
    public void setKnowCommentUp(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_KNOW_COMMENT_UP_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_KNOW_COMMENT_UP_URL);
        }
        hp.putParam("jsonBean", jsonBean);
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(2);
        hp.setCallBack(listener);
        hp.post();
    }

    // 知识库 相关
    public void getKnowRelate(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_KNOW_RELATE_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_KNOW_RELATE_UP_URL);
        }
        hp.putParam("jsonBean", jsonBean);
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1);
        hp.setCallBack(listener);
        hp.post();
    }


    //添加浙江联泰为好友企业
    public void addLtsFriends(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        hp.setUrl(Api.$().OWNER_ADD_LTS_FRIENDS);
        hp.putParam("jsonBean", jsonBean);
        hp.setshowDialogcontent("正在添加好友");
        hp.setRequsetId(999);
        hp.setCallBack(listener);
        hp.post();
    }

    // 更换手机 获取验证码
    public void getChangeMoblieCode(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_CHANGE_MOBILE_CODE_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_CHANGE_MOBILE_CODE_URL);
        }
        hp.putParam("jsonBean", jsonBean);
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(1);
        hp.setCallBack(listener);
        hp.post();
    }

    // 更换手机 提交
    public void changeMoblie(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_CHANGE_MOBILE_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_CHANGE_MOBILE_URL);
        }
        hp.putParam("jsonBean", jsonBean);
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(2);
        hp.setCallBack(listener);
        hp.post();
    }

    //是否显示邀请好友企业弹窗
    public void dialogInvite(Context context, String jsonBean, HttpTaskListener listener) {
        HttpPresenter hp = new HttpPresenter(context);
        if ("1".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().OWNER_INVITE_DIALOG_URL);
        } else if ("2".equals(YunLongApplication.getCompanyType())) {
            hp.setUrl(Api.$().SERVICE_INVITE_DIALOG_URL);
        }
        hp.putParam("jsonBean", jsonBean);
        hp.setshowDialogcontent("正在加载");
        hp.setRequsetId(2);
        hp.setCallBack(listener);
        hp.post();
    }
}
